clear all;
R = 220;
C = 33e-12;
tau =2*R*C;
fprintf( 'tau = % f ns\n' , tau*1e9)
T = tau/100;
fprintf( 'T = % f ns\n' , tau*1e9)
t = 0 : T : 4*tau;
U(1) = 0;
for k = 2 : length(t);
     Z(k) = 3*sin(6*pi*k/length(t));
     C(k) = 0.6;

end
for n = 0:0.25:3
for k = 2 : length(t);
    S =n*sin(6*pi*k/length(t));
    U(k) = (S+tau/T*U(k-1)-0.6)/(1+tau/T);
    if S-U(k)<0.6
       U(k)=U(k-1);
    end
end
plot(t,U,t,Z,t,C)
hold all
end